import threading
import requests, json, time


class Manager:
    def __init__(self, cfg_path):
        self.mutex = threading.Lock()

        # self.cfg_path = cfg_path
        
        # with open(cfg_path, "r") as rf:
        #     self.data = json.loads(rf.read())

        print("0", time.time())

        t = threading.Thread(target=Manager.run, args=(self,))
        t.setDaemon(1)
        t.start()
        t.join()
        print("1", time.time())

    def run(self):
        while True:
            print("2", time.time())
            time.sleep(5)


def test_thread():
    mng = Manager("./cfg.json")
    # while 1:
    #     print("3")
    #     time.sleep(2)

if __name__ == "__main__":
    test_thread()